//
//  Hunter.m
//  server
//
//  Created by Jan Nase on 23.12.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Hunter.h"


@implementation Hunter

@synthesize runnerID;

-(id)initWithCoder:(NSCoder *)aDecoder{
    self = [super initWithCoder:aDecoder];
  if (self) {
      //initWithString throws an exception when called with nil argument
      if([aDecoder decodeObjectForKey:@"runnerID"]) {
          runnerID = [[NSString alloc] initWithString:[aDecoder decodeObjectForKey:@"runnerID"]];
      }
      else {
          runnerID = nil;
      }
  }
    
  return self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
	[super encodeWithCoder:aCoder];	
    [aCoder encodeObject:runnerID forKey:@"runnerID"];	
}

-(void)dealloc{
    [runnerID release];
	[super dealloc];
}

-(NSString*) description {
  return [NSString stringWithFormat:@"HUNTER: %@ @ (%f, %f)", name, last_position_lat, last_position_long];
}

@end

